# coding: utf8
'''
@author: Pierre Thibault
@license: GPL 3
@since: 2010-08-19

'''

import sys
from gluon.admin import apath
from uc_tools import expand_abbreviation
from uc_tools import get_applications

if False:
    # Fake the imports needed by the static code analyzer.
#    import gluon.languages.translator as T
#    from gluon.cache import Cache
    #from gluon.contrib.gql import GQLDB
    from gluon.globals import Request
    from gluon.globals import Response
#    from gluon.globals import Session
    #from gluon.html import *
    #from gluon.html import URL
    #from gluon.http import HTTP
    #from gluon.http import redirect
#    from gluon.sql import DAL
    #from gluon.sql import Field
    #from gluon.sql import SQLDB
    #from gluon.sqlhtml import SQLFORM
#    import gluon.tools
    #from gluon.validators import *
#    auth = gluon.tools.Auth()
#    cache = Cache()
#    db = DAL()
    request = Request()
    response = Response()
#    service = gluon.tools.Service()
#    session = Session()

def index():
    """
    TODO: This is the beginning of an application installer...
    """
    response.title = request.application
    response.subtitle = request.application + " application installer"
    
    # Build the application menu:
    applications = get_applications(request)
    
    return dict(path=get_applications(request))

def test_expand_abbreviation():
    """
    >>> expand_abbreviation("Mr", "en", T)
    'Mister'
    
    >>> expand_abbreviation("Me", "fr", T)
    'Ma\\xc3\\xaetre'
    
    >>> expand_abbreviation("Mrs", "en", T)
    'Misses'
    
    >>> expand_abbreviation("Mlle", "fr", T)
    'Mademoiselle'
    """
    return